// 
// Decompiled by Procyon v0.5.36
// 

package com.cyberfend.cyfsecurity;

import java.util.*;
import android.os.*;
import com.cyberfend.cyfsecurity.b.*;

final class ab implements java.util.Observer
{
    private final com.cyberfend.cyfsecurity.z b;
    long a;
    
    ab() {
        this.a = 0L;
        this.b = new com.cyberfend.cyfsecurity.z(this);
    }
    
    @java.lang.Override
    public final void update(final java.util.Observable observable, final java.lang.Object data) {
        try {
            if (data == null) {
                if (a()) {
                    com.cyberfend.cyfsecurity.CYFMonitor.b().b();
                }
                if (com.cyberfend.cyfsecurity.d.d && a()) {
                    com.cyberfend.cyfsecurity.b.a(1);
                }
            }
            else {
                final com.cyberfend.cyfsecurity.ac ac = (com.cyberfend.cyfsecurity.ac)data;
                final com.cyberfend.cyfsecurity.z b = this.b;
                final com.cyberfend.cyfsecurity.ac ac2 = ac;
                final com.cyberfend.cyfsecurity.z z = b;
                long a = 0L;
                final com.cyberfend.cyfsecurity.ab ab;
                if ((ab = z.a.get()) != null) {
                    a = ab.a;
                }
                z.f = ac2.a.getPointerCount();
                if (ac2.c == 1) {
                    z.e = 0;
                    while (z.e < z.f) {
                        if (android.os.Build$VERSION.SDK_INT >= 14) {
                            z.c = ac2.a.getToolType(z.e);
                        }
                        else {
                            z.c = -1;
                        }
                        z.d = ac2.b + "," + (ac2.a.getEventTime() - a) + "," + z.b.format(ac2.a.getX(z.e)) + "," + z.b.format(ac2.a.getY(z.e)) + "," + ac2.a.getPointerCount() + ",1," + z.c + ",-1;";
                        com.cyberfend.cyfsecurity.e.a += z.d;
                        com.cyberfend.cyfsecurity.e.b += ac2.a.getEventTime() - a + ac2.b + com.cyberfend.cyfsecurity.u.b(z.b.format(ac2.a.getX(z.e))) + com.cyberfend.cyfsecurity.u.b(z.b.format(ac2.a.getY(z.e)));
                        ++com.cyberfend.cyfsecurity.e.e;
                        final com.cyberfend.cyfsecurity.z z2 = z;
                        ++z2.e;
                    }
                }
                else {
                    if (android.os.Build$VERSION.SDK_INT >= 14) {
                        z.c = ac2.a.getToolType(ac2.a.getActionIndex());
                    }
                    else {
                        z.c = -1;
                    }
                    z.d = ac2.b + "," + (ac2.a.getEventTime() - a) + "," + z.b.format(ac2.a.getX(ac2.a.getActionIndex())) + "," + z.b.format(ac2.a.getY(ac2.a.getActionIndex())) + "," + ac2.a.getPointerCount() + ",1," + z.c + ",-1;";
                    com.cyberfend.cyfsecurity.e.a += z.d;
                    com.cyberfend.cyfsecurity.e.b = com.cyberfend.cyfsecurity.e.b + (ac2.a.getEventTime() - a) + ac2.b + com.cyberfend.cyfsecurity.u.b(z.b.format(ac2.a.getX(ac2.a.getActionIndex()))) + com.cyberfend.cyfsecurity.u.b(z.b.format(ac2.a.getY(ac2.a.getActionIndex())));
                    ++com.cyberfend.cyfsecurity.e.f;
                }
                new java.lang.StringBuilder("Count: ").append(com.cyberfend.cyfsecurity.e.j).append(", Touch String ").append(z.d);
                this.a = ac.a.getEventTime();
            }
        }
        catch (java.lang.Exception ex) {
            com.cyberfend.cyfsecurity.b.a.b("TouchManager", "Exception in processing touch event", ex);
            com.cyberfend.cyfsecurity.f.a(ex);
        }
    }
    
    private static boolean a() {
        return com.cyberfend.cyfsecurity.e.j == 1L || com.cyberfend.cyfsecurity.e.j == 6L || (com.cyberfend.cyfsecurity.e.j > 6L && (com.cyberfend.cyfsecurity.e.j - 6L) % 10L == 0L);
    }
}
